package com.beta.service;

import com.baomidou.framework.service.ISuperService;
import com.beta.em.order.TransactionType;
import com.beta.entity.OltpTxnLogs;
import com.beta.entity.Orders;
import com.beta.entity.Users;

import java.math.BigDecimal;
import java.util.List;

/**
 *
 * OltpTxnLogs 表数据服务层接口
 *
 */
public interface IOltpTxnLogsService extends ISuperService<OltpTxnLogs> {

    /**
     * 记录用户交易流水
     * @param order
     * @param users
     * @param txnType
     * @param amount
     * @param balance
     */
    void logUserTransaction(Orders order, Users users, TransactionType txnType, BigDecimal amount, BigDecimal balance);

    /**
     * 记录平台交易流水
     * @param order
     * @param txnType
     * @param amount
     * @param balance
     */
    void logPlatformTransaction(Orders order, TransactionType txnType, BigDecimal amount, BigDecimal balance);

    /**
     * 获得用户订单的交易流水日志
     * @param userId
     * @param ordersId
     * @param txnTypes
     * @return
     */
    List<OltpTxnLogs> getUserOrderLogs(Integer userId, Integer ordersId, List<String> txnTypes);

    List<OltpTxnLogs> getLogByOrderAndTxnType(Integer orderId, TransactionType txnType);

}